package com.minigame.common;

import lombok.AllArgsConstructor;
import lombok.Data;

import static com.minigame.common.ApiResponseStatusEnum.SUCCESS;

@Data
@AllArgsConstructor
public class ApiResponse<T> {
    private int code;
    private String message;
    private T data;

    public ApiResponse(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ApiResponse() {
        this(SUCCESS.getCode(), SUCCESS.getMessage());
    }

    public ApiResponse(T data) {
        this.code = SUCCESS.getCode();
        this.message = SUCCESS.getMessage();
        this.data = data;
    }
}
